﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
using System.IO;

/* TODO
 * Complete redesign of the guns system to make them utilise objects
 *  - There will be a total of 5 gun objects, stored in a stack, stack size limited
 * by gun mounts.
 *  - Guns will have attributes: weights, damages, cost, requirements etc.
 *  - Using objects will provide access to a variety of data types for each attribute.
 *  
 * 
 * updateGun();
 * 
 * Push - creates a new instance of shipGun, adds it to the top of the stack.
 * Pop  - removes the last gun from the stack, clearing its data in the process.
 *           stackS stack = new stackS();
            shipGun newShipGun = new shipGun(1,3,4,5,"");
            stack.push(newShipGun);
 */

namespace pardusshipcalc.ShipStructure
{
    class shipGun
    {
        private int damage;
        private int fireRate;
        private int weight;
        private int cost;
        int gunValue;
        private string rankImagePath;
        private string equipmentImagePath;
        private int xpRequirement;
        private int gType; /* 0 = conv, 1 = org; 2 = em; 3 = pardus */
        bool pardusWeap;
        int crystalsRequired;
        int rankValue = 0;

        public shipGun(int gVal)
        {
            gunValue = gVal;
            damage = 0; 
            fireRate = 0;
            weight = 0; 
            cost = 0; 
            pardusWeap = false; 
            xpRequirement = 0;
            rankImagePath = null; 
            equipmentImagePath = null; 
            crystalsRequired = 0; 
            gType = 0;
            rankValue = 0;
        }

        public void intialiseGun(int type)
        {
            damage = 0; fireRate = 0; weight = 0; cost = 0; pardusWeap = false; xpRequirement = 0; rankImagePath = null; equipmentImagePath = null; crystalsRequired = 0; gType = 0; rankValue = 0;
            switch (type)
            {
                case 3: damage = 6; fireRate = 1; weight = 4; cost = 1000; gType = 0; equipmentImagePath = Path.Combine("equipment", "MWmin010.png"); break; /* 10MW Mining Laser */
                case 4: damage = 15; fireRate = 1; weight = 6; cost = 5000; gType = 0; equipmentImagePath = Path.Combine("equipment", "MWmin030.png"); break; /* 30 MW Mining */
                case 5: damage = 21; fireRate = 1; weight = 2; cost = 12000; gType = 0; equipmentImagePath = Path.Combine("equipment", "MWimp001.png"); break; /* 1MW Impulse */
                case 6: damage = 30; fireRate = 1; weight = 3; cost = 28000; gType = 0; equipmentImagePath = Path.Combine("equipment", "MWimp005.png"); break; /* 5MW Impulse */
                case 7: damage = 27; fireRate = 2; weight = 4; cost = 86000; rankImagePath = null; xpRequirement = 360; gType = 0; equipmentImagePath = Path.Combine("equipment", "MWpar001.png"); break; /*1MW Particle */
                case 8: damage = 42; fireRate = 2; weight = 8; cost = 210000; rankImagePath = null; xpRequirement = 1600; gType = 0; equipmentImagePath = Path.Combine("equipment", "MWpar004.png"); break; /* 4MW Particle */
                case 9: damage = 42; fireRate = 2; weight = 5; cost = 510000; rankImagePath = null; xpRequirement = 4600; gType = 0; equipmentImagePath = Path.Combine("equipment", "MWlwpar004.png"); break; /* 4MW LW Particle */
                case 10: damage = 60; fireRate = 2; weight = 14; cost = 550000; xpRequirement = 5000; gType = 0; equipmentImagePath = Path.Combine("equipment", "MWpar020.png"); break; /* 20 MW Paticle */
                case 11: damage = 60; fireRate = 2; weight = 10; cost = 925000; xpRequirement = 8750; gType = 0; equipmentImagePath = Path.Combine("equipment", "MWlwpar020.png"); break; /* 20 MW LW */
                case 12: damage = 84; fireRate = 2; weight = 30; cost = 980000; xpRequirement = 9300; gType = 0; equipmentImagePath = Path.Combine("equipment", "MWpar100.png"); break; /* 100 MW Particle */
                case 13: damage = 84; fireRate = 2; weight = 24; cost = 2000000; xpRequirement = 19500; gType = 0; equipmentImagePath = Path.Combine("equipment", "MWlwpar100.png"); break; /* 100 MW Particle */

                case 16: damage = 30; fireRate = 3; weight = 22; cost = 180000; rankImagePath = Path.Combine("factions", "emprank3.png"); gType = 0; equipmentImagePath = Path.Combine("equipment", "MWgat004.png"); xpRequirement = 0; rankValue = 23; break; /* 4MW Gatling */
                case 17: damage = 30; fireRate = 3; weight = 14; cost = 540000; rankImagePath = Path.Combine("factions", "emprank7.png"); gType = 0; equipmentImagePath = Path.Combine("equipment", "MWlwgat004.png"); xpRequirement = 0; rankValue = 27; break; /* 4MW LW gatling */
                case 18: damage = 48; fireRate = 3; weight = 34; cost = 400000; rankImagePath = Path.Combine("factions", "emprank5.png"); gType = 0; equipmentImagePath = Path.Combine("equipment", "MWgat006.png"); xpRequirement = 0; rankValue = 25; break; /* 6MW gatling */
                case 19: damage = 48; fireRate = 3; weight = 20; cost = 1200000; rankImagePath = Path.Combine("factions", "emprank9.png"); gType = 0; equipmentImagePath = Path.Combine("equipment", "MWlwgat006.png"); xpRequirement = 0; rankValue = 29; break; /* 6MW LW*/
                case 20: damage = 69; fireRate = 3; weight = 50; cost = 720000; rankImagePath = Path.Combine("factions", "emprank8.png"); gType = 0; equipmentImagePath = Path.Combine("equipment", "MWgat010.png"); xpRequirement = 0; rankValue = 28; break; /* 10MW gatling */
                case 21: damage = 69; fireRate = 3; weight = 30; cost = 2160000; rankImagePath = Path.Combine("factions", "emprank12.png"); gType = 0; equipmentImagePath = Path.Combine("equipment", "MWlwgat010.png"); xpRequirement = 0; rankValue = 212; break; /* 10 MW LW gatling */
                case 22: damage = 115; fireRate = 3; weight = 78; cost = 2200000; rankImagePath = Path.Combine("factions", "emprank13.png"); gType = 0; equipmentImagePath = Path.Combine("equipment", "MWgat020.png"); xpRequirement = 0; rankValue = 213; break; /* 20 MW gat */
                case 23: damage = 115; fireRate = 3; weight = 60; cost = 6600000; rankImagePath = Path.Combine("factions", "emprank14.png"); gType = 0; equipmentImagePath = Path.Combine("equipment", "MWlwgat020.png"); xpRequirement = 0; rankValue = 214; break; /* 20 MW LW gat */
                case 24: damage = 240; fireRate = 1; weight = 38; cost = 2280000; rankImagePath = Path.Combine("factions", "emprank12.png"); gType = 0; equipmentImagePath = Path.Combine("equipment", "MWplas035.png"); xpRequirement = 0; rankValue = 212; break; /* 35MW Plasma */
                case 25: damage = 270; fireRate = 1; weight = 42; cost = 2500000; rankImagePath = Path.Combine("factions", "emprank13.png"); gType = 0; equipmentImagePath = Path.Combine("equipment", "MWplas040.png"); xpRequirement = 0; rankValue = 213; break; /* 40MW Plasma*/
                case 26: damage = 345; fireRate = 1; weight = 54; cost = 8250000; rankImagePath = Path.Combine("factions", "emprank14.png"); gType = 0; equipmentImagePath = Path.Combine("equipment", "MWplas060.png"); xpRequirement = 0; rankValue = 214; break; /* 65 MW plasma */
                case 27: damage = 102; fireRate = 2; weight = 36; cost = 1400000; rankImagePath = Path.Combine("factions", "emprank10.png"); gType = 0; equipmentImagePath = Path.Combine("equipment", "MWpar140.png"); xpRequirement = 0; rankValue = 210; break; /* 140MW Part */
                case 28: damage = 102; fireRate = 2; weight = 28; cost = 2400000; rankImagePath = Path.Combine("factions", "emprank11.png"); gType = 0; equipmentImagePath = Path.Combine("equipment", "MWlwpar140.png"); xpRequirement = 0; rankValue = 211; break; /* 140 MW LW Part */

                case 31: damage = 36; fireRate = 2; weight = 4; cost = 580000; xpRequirement = 5300; gType = 1; equipmentImagePath = Path.Combine("equipment", "exo.png"); break; /* Exoplasm */
                case 32: damage = 42; fireRate = 2; weight = 8; cost = 400000; xpRequirement = 3500; gType = 1; equipmentImagePath = Path.Combine("equipment", "endo.png"); break; /* endoplasm */
                case 33: damage = 42; fireRate = 3; weight = 16; cost = 850000; xpRequirement = 8000; gType = 1; equipmentImagePath = Path.Combine("equipment", "bsp.png"); break; /* BSA */
                case 34: damage = 78; fireRate = 2; weight = 28; cost = 1680000; xpRequirement = 16300; gType = 1; equipmentImagePath = Path.Combine("equipment", "viralg.png"); break; /* VG */

                case 37: damage = 39; fireRate = 2; weight = 6; cost = 650000; xpRequirement = 6000; gType = 2; equipmentImagePath = Path.Combine("equipment", "MTmd080.png"); break; /* 80MT Magdef */
                case 38: damage = 51; fireRate = 2; weight = 7; cost = 950000; xpRequirement = 9000; gType = 2; equipmentImagePath = Path.Combine("equipment", "MTmd120.png"); break; /* 120 Magdef */
                case 39: damage = 165; fireRate = 1; weight = 30; cost = 1980000; xpRequirement = 19300; gType = 2; equipmentImagePath = Path.Combine("equipment", "lpc.png"); break; /* LPC */
                case 40: damage = 210; fireRate = 1; weight = 40; cost = 2600000; xpRequirement = 25500; gType = 2; equipmentImagePath = Path.Combine("equipment", "vlpc.png"); break; /* VLPC */

                case 43: damage = 40; fireRate = 2; weight = 8; cost = 200000; xpRequirement = 0; gType = 3; crystalsRequired = 8; pardusWeap = true; equipmentImagePath = Path.Combine("equipment", "par01.png"); break; /* LE1*/
                case 44: damage = 55; fireRate = 2; weight = 14; cost = 400000; xpRequirement = 0; gType = 3; crystalsRequired = 14; pardusWeap = true; equipmentImagePath = Path.Combine("equipment", "par02.png"); break; /*LEII */
                case 45: damage = 150; fireRate = 1; weight = 34; cost = 800000; xpRequirement = 0; gType = 3; crystalsRequired = 32; pardusWeap = true; equipmentImagePath = Path.Combine("equipment", "par03.png"); break; /* Lucidi Conqueror */
                case 46: damage = 90; fireRate = 2; weight = 56; cost = 1600000; xpRequirement = 0; gType = 3; crystalsRequired = 40; pardusWeap = true; equipmentImagePath = Path.Combine("equipment", "par03.png"); break; /* LPT */

                default: damage = 0; fireRate = 0; weight = 0; cost = 0; pardusWeap = false; xpRequirement = 0; rankImagePath = null; equipmentImagePath = null; crystalsRequired = 0; gType = 0; rankValue = 0; break;
            }
        }

        
        #region GETTERS
        public int getGunCost()
        {
            return cost;
        }
        public int getGunWeight()
        {
            return weight;
        }
        public int getRankValue()
        {
            return rankValue;
        }
        public int getGunDamage()
        {
            return damage;
        }
        public int getFireRate()
        {
            return fireRate;
        }
        public string getRankImagePath()
        {
            return rankImagePath;
        }
        public string getEquipmentImagePath()
        {
            return equipmentImagePath;
        }
        public int getXPRequirement()
        {
            return xpRequirement;
        }
        public bool pardusWeapon()
        {
            return pardusWeap;
        }
        public int getCrystals()
        {
            if (pardusWeap == true)
            {
                return crystalsRequired;
            }
            else
            {
                return -1;
            }
        }
        public int getGunType()
        {
            return gType;
        }
        public int getGunNumber()
        {
            return gunValue;
        }
        #endregion


    }
}
